import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询礼物列表
export function listGift(data) {
  return request({
    url: '/market/gift/giftList',
    method: 'post',
    data: data
  })
}

// 查询礼物详细
export function getGift(giftId) {
  return request({
    url: '/market/gift/' + parseStrEmpty(giftId),
    method: 'get'
  })
}

// 新增礼物
export function addGift(data) {
  return request({
    url: '/market/gift',
    method: 'post',
    data: data
  })
}

// 修改礼物
export function updateGift(data) {
  return request({
    url: '/market/gift',
    method: 'put',
    data: data
  })
}

// 删除礼物
export function delGift(giftId) {
  return request({
    url: '/market/gift/' + giftId,
    method: 'delete'
  })
}

// 礼物状态修改
export function changeGiftStatus(giftId, status) {
  const data = {
    giftId,
    status
  }
  return request({
    url: '/market/gift/giftChangeStatus',
    method: 'put',
    data: data
  })
}
